package com.weishi.pay.config.mq;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * Class_Name: RocketMqProperties
 * Package: com.weishinfo.center.user.rpc.service.config
 * Describer: RocketMQ属性配置类
 *
 * @author chixiahua
 * @date 2018/7/3 18:07
 **/
@Component
@ConfigurationProperties(prefix = RocketMqProperties.MQ_CONF_PREFIX)
public class RocketMqProperties {

    /**
     * 属性配置前缀
     */
    public static final String MQ_CONF_PREFIX = "com.weishinfo.mq";

    /**
     * 生产者groupName
     */
    private String producerGroupName;

    /**
     * 消费者groupName
     */
    private String consumerGroupName;

    /**
     * 生产者实例名
     */
    private String producerInstanceName;

    /**
     * 消费者实例名称
     */
    private String consumerInstanceName;

    /**
     * 一次最大消费多少消息数量
     */
    private Integer consumerBactchMaxSize;

    /**
     * 启动的时候是否消费历史记录
     */
    private boolean enableHisConsumer;

    /**
     * 是否启动顺序消费
     */
    private boolean enableOrderConsumer;

    /**
     * 是否启动广播消费
     */
    private boolean consumerBroadcasting;

    /**
     * name服务器地址
     */
    private String nameServerAddr;

    private List<String> subscribers = new ArrayList<>();

    public List<String> getSubscribers() {
        return subscribers;
    }

    public void setSubscribers(List<String> subscribers) {
        this.subscribers = subscribers;
    }

    public String getProducerGroupName() {
        return producerGroupName;
    }

    public void setProducerGroupName(String producerGroupName) {
        this.producerGroupName = producerGroupName;
    }

    public String getConsumerGroupName() {
        return consumerGroupName;
    }

    public void setConsumerGroupName(String consumerGroupName) {
        this.consumerGroupName = consumerGroupName;
    }

    public String getProducerInstanceName() {
        return producerInstanceName;
    }

    public void setProducerInstanceName(String producerInstanceName) {
        this.producerInstanceName = producerInstanceName;
    }

    public String getConsumerInstanceName() {
        return consumerInstanceName;
    }

    public void setConsumerInstanceName(String consumerInstanceName) {
        this.consumerInstanceName = consumerInstanceName;
    }

    public Integer getConsumerBactchMaxSize() {
        return consumerBactchMaxSize;
    }

    public void setConsumerBactchMaxSize(Integer consumerBactchMaxSize) {
        this.consumerBactchMaxSize = consumerBactchMaxSize;
    }

    public boolean isEnableHisConsumer() {
        return enableHisConsumer;
    }

    public void setEnableHisConsumer(boolean enableHisConsumer) {
        this.enableHisConsumer = enableHisConsumer;
    }

    public boolean isEnableOrderConsumer() {
        return enableOrderConsumer;
    }

    public void setEnableOrderConsumer(boolean enableOrderConsumer) {
        this.enableOrderConsumer = enableOrderConsumer;
    }

    public boolean isConsumerBroadcasting() {
        return consumerBroadcasting;
    }

    public void setConsumerBroadcasting(boolean consumerBroadcasting) {
        this.consumerBroadcasting = consumerBroadcasting;
    }

    public String getNameServerAddr() {
        return nameServerAddr;
    }

    public void setNameServerAddr(String nameServerAddr) {
        this.nameServerAddr = nameServerAddr;
    }
}
